/**
 * @class User
 * @description Class for a LastFM User Object
 */
var User = function()
{
	this.id = "";
	this.name = "";
	this.realname = "";
	this.url = "";
	this.image = "";
	this.country = "";
	this.age = 0;
	this.gender = "";
	this.subscriber = 0;
	this.playcount = 0;
	this.playlists = 0;
	this.bootstrap = 0;
	this.registeredDate = "";

	this.artists = new Array();
	this.friends = new Array();

	/**
	 * Init the user object
	 * 
	 * @param result Array
	 */
	this.init = function(result)
	{
		this.id = result["id"];
		this.name = result["name"];
		this.realname = result["realname"];
		this.url = result["url"];
		this.image = result["image"][3];
		this.country = result["country"];
		this.age = result["age"];
		this.gender = result["gender"];
		this.subscriber = result["subscriber"];
		this.playcount = result["playcount"];
		this.playlists = result["playlists"];
		this.bootstrap = result["bootstrap"];
		this.registeredDate = result["registered"];
	}

	/**
	 * Get all the artist from this user
	 * 
	 * @param artistCount int
	 */
	this.getArtists = function(artistCount)
	{
		dataLayer.getArtistsByUser(this, artistCount);
	}

	/**
	 * Get all the friends from this user
	 *
	 * @param friendCount int
	 */
	this.getFriends = function(friendCount)
	{
		dataLayer.getFriendsByUser(this, friendCount);
	}
}